package com.medical.doctor.controller;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArraySet;

import com.medical.doctor.entity.PatientPatientEntity;
import com.medical.doctor.feign.PatientMedicalRecordFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.medical.doctor.entity.ClinialEntity;
import com.medical.doctor.service.ClinialService;
import com.medical.common.utils.PageUtils;
import com.medical.common.utils.R;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2021-08-22 08:46:08
 */
@RestController
@RequestMapping("doctor/clinial")
public class ClinialController {
    @Autowired
    private ClinialService clinialService;



    //接诊台
    @RequestMapping("/clinialList")
    public ClinialEntity clinicalVoList(){
        return clinialService.clinicalVoList();
    }

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = clinialService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{clinialId}")
    public R info(@PathVariable("clinialId") Integer clinialId){
		ClinialEntity clinial = clinialService.getById(clinialId);

        return R.ok().put("clinial", clinial);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ClinialEntity clinial){
		clinialService.save(clinial);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ClinialEntity clinial){
		clinialService.updateById(clinial);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] clinialIds){
		clinialService.removeByIds(Arrays.asList(clinialIds));

        return R.ok();
    }

}
